/*!
\copyright  Copyright (c) 2024 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\addtogroup swift_pair
\brief      Swift Pair configuration

            Feature config options:
                FEATURE_SWIFT_PAIR_OPTION_SET_PAIRING_MODE, pair using bredr only, LE only or dual mode using CTKD
                FEATURE_SWIFT_PAIR_OPTION_INCLUDE_DEVICE_NAME, to include the optional device 
                                                name as either part of the fast pair data or as it's own ad type
                FEATURE_SWIFT_PAIR_OPTION_ADVERTISMENT_TYPE, legacy or extended advertising

@{
*/

#ifndef SWIFT_PAIR_CONFIG_H_
#define SWIFT_PAIR_CONFIG_H_

#include "swift_pair.h"

typedef enum
{
    swift_pair_pairing_mode_dual_mode,
    swift_pair_pairing_mode_le_only,
    swift_pair_pairing_mode_bredr_only,
} swift_pair_pairing_mode_t;

typedef enum
{
    swift_pair_exclude_device_name,
    swift_pair_include_device_name_as_swift_pair_data,
    swift_pair_include_device_name_as_seperate_ad_type,
} swift_pair_device_name_option_t;

typedef enum
{
    swift_pair_use_extended_advertising,
    swift_pair_use_legacy_advertising,
} swift_pair_advertisment_type_t;

typedef struct
{
    swift_pair_pairing_mode_t mode;
    swift_pair_device_name_option_t device_name_option;
    swift_pair_advertisment_type_t advertisment_type;
} swift_pair_config_t;

// configuration via build flags
#ifdef FEATURE_SWIFT_PAIR_OPTION_SET_PAIRING_MODE
#define PAIRING_MODE        FEATURE_SWIFT_PAIR_OPTION_SET_PAIRING_MODE
#else
#define PAIRING_MODE        swift_pair_pairing_mode_dual_mode
#endif

#ifdef FEATURE_SWIFT_PAIR_OPTION_INCLUDE_DEVICE_NAME
#define DEVICE_NAME_OPTION  FEATURE_SWIFT_PAIR_OPTION_INCLUDE_DEVICE_NAME
#else
#define DEVICE_NAME_OPTION  swift_pair_exclude_device_name
#endif

#ifdef FEATURE_SWIFT_PAIR_OPTION_ADVERTISMENT_TYPE
#define ADVERTISMENT_TYPE   FEATURE_SWIFT_PAIR_OPTION_ADVERTISMENT_TYPE
#else
#define ADVERTISMENT_TYPE   swift_pair_use_extended_advertising
#endif

#ifdef FEATURE_SWIFT_PAIR_OPTION_MAX_ADVERT_SIZE
#define MAX_ADVERT_SIZE     FEATURE_SWIFT_PAIR_OPTION_MAX_ADVERT_SIZE
#else
#define MAX_ADVERT_SIZE     31
#endif

#ifdef FEATURE_SWIFT_PAIR_OPTION_PAUSE_WHEN_NOT_PRIMARY
#define PAUSE_WHEN_NOT_PRIMARY   FEATURE_SWIFT_PAIR_OPTION_PAUSE_WHEN_NOT_PRIMARY
#else
#ifdef INCLUDE_TWS
#define PAUSE_WHEN_NOT_PRIMARY   (1)
#else
#define PAUSE_WHEN_NOT_PRIMARY   (0)
#endif
#endif



/*! \brief Configure the swit pair component.

    \param  config       configuration
 */
void SwiftPair_SetConfig(swift_pair_config_t * config);

/*! \brief Get the current swit pair component configuration.

    \param  config       Initialization Task
 */
swift_pair_config_t * SwiftPair_GetConfig(void);

#endif